def bubble_sort(nums):
    swapped = True
    while swapped:
        swapped = False
        for i in range(len(nums)-1):
            if nums[i] > nums[i + 1]:
                nums[i],nums[i + 1]=nums[i + 1],nums[i]
                swapped = True
def read2list(filename):
    file=open(filename, 'r')
    data=file.readlines()
    return data
s1=read2list("s1.txt")
s2=read2list("s2.txt")
s3=read2list("s3.txt")

t_start=time.time()
b_sort(s1)
t_finish=time.time()
print("s1",round((t_finish-t_start)*1000),"milliseconds")

t_start=time.time()
b_sort(s2)
t_finish=time.time()
print("s2",round((t_finish-t_start)*1000),"milliseconds")

t_start=time.time()
b_sort(s3)
t_finish=time.time()
print("s3",round((t_finish-t_start)*1000),"milliseconds")



                
    
